<% layout('/layouts/default.html', {title: '任务过程审核-细化分解确认审核', libs: ['validate','fileupload','dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<#form:form id="inputForm" model="${dcSupTaskAudit}" action="${ctx}/audit/dcSupTaskAudit/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('任务信息')}</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">${text('任务年度')}：</label>
							<div class="col-sm-8">
								<label class="control-label " title="">${dcSupTaskAudit.dcSupTaskInfo.taskYear}年</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">${text('任务类型')}：</label>
							<div class="col-sm-8">
								<label class="control-label " title="" style="text-align: left">${dcSupTaskAudit.dcSupTaskInfo.taskTypeName}</label>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">${text('任务标题')}：</label>
							<div class="col-sm-8">
								<label class="control-label " title="" style="text-align: left;white-space: pre-line;">${text(dcSupTaskAudit.dcSupTaskInfo.taskTitle)}</label>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">${text('任务内容')}：</label>
							<div class="col-sm-8">
								<label class="control-label " title="" style="text-align: left;white-space: pre-line;">${text(dcSupTaskAudit.dcSupTaskInfo.taskContent)}</label>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">${text('起止时间')}：</label>
							<div class="col-sm-8">
								<label class="control-label " title="" style="text-align: left">${text(@DateUtils.formatDate(dcSupTaskAudit.dcSupTaskInfo.taskStartTime,'yyyy-MM-dd HH:mm'))}</label>
								至
								<label class="control-label " title="" style="text-align: left">${text(@DateUtils.formatDate(dcSupTaskAudit.dcSupTaskInfo.taskEndTime,'yyyy-MM-dd HH:mm'))}</label>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('督办要求')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label" title="" style="text-align: left;white-space: pre-line;">${dcSupTaskAudit.dcSupTaskInfo.taskRequireName!'无'}</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">${text('牵头领导')}：</label>
							<div class="col-sm-8">
								<label class="control-label " title="" style="text-align: left">${dcSupTaskAudit.dcSupTaskInfo.taskLeaderName!'无'}</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">${text('牵头责任单位')}：</label>
							<div class="col-sm-8">
								<label class="control-label " title="" style="text-align: left">${dcSupTaskAudit.dcSupTaskInfo.taskLeaderOrgName!'无'}</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">${text('联系人')}：</label>
							<div class="col-sm-8">
								<label class="control-label " title="" style="text-align: left">${dcSupTaskAudit.dcSupTaskInfo.contactName!'无'}</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">${text('联系电话')}：</label>
							<div class="col-sm-8">
								<label class="control-label " title="" style="text-align: left">${dcSupTaskAudit.dcSupTaskInfo.contactPhone!'无'}</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('督办字号')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label" title="" style="text-align: left">${dcSupTaskAudit.dcSupTaskInfo.messageNumber!'无'}</label>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">
								<span class="required hide">*</span> ${text('附件上传')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadFile" bizKey="${dcSupTaskAudit.dcSupTaskInfo.id}" bizType="dcSupTaskInfo_file"
								uploadType="all" class="" readonly="true" preview="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="form-unit">${text('细化分解确认')}</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('反馈时间要求')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label">${dcSupTaskAudit.dcSupTaskInfo.feedbackWay!'无'}</label>
							</div>
						</div>
					</div>
				</div>
				<div class="row ">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-1">
								<span class="required hide">*</span> </label>
							<div class="col-sm-11">
								<table id="scheBusiTaskFeedbackDataGrid"></table>
							</div>
						</div>
					</div>
				</div>
				<#form:hidden path="id"/>
				<#form:hidden path="targetId"/>
				<#form:hidden path="targetType"/>
				<#form:hidden path="dcSupTaskInfo.id"/>
				<div class="form-unit">${text('审核信息')}</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> ${text('审核结果')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:radio path="auditResult" dictType="dc_audit_result" defaultValue="1" class="form-control required"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('审核意见')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="auditOption" rows="4" style="white-space: pre-line;" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('audit:dcSupTaskAudit:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('提 交')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});

//初始化多次反馈表DataGrid对象
$("#scheBusiTaskFeedbackDataGrid").dataGrid({
	data:${toJson(dcSupTaskAudit.dcSupTaskInfo.dcSupTaskInfoAddList)},
	datatype: "local", // 设置本地数据
	autoGridHeight: function(){return 'auto'}, // 设置自动高度
	// 设置数据表格列
	columnModel: [
		{header:'主键', name:'id', editable:true, hidden:true},
		{header:'${text("任务表主键")}', name:'taskId', editable:true, hidden:true},
		{header:'${text("反馈开始日期")}', name:'feedbackStartTime', width:100,
			formatter:'date', formatoptions:{srcformat:'Y-m-d H:i',newformat:'Y-m-d H:i'},
			editable:true, edittype:'text',align:"center", editoptions:{'class':'form-control laydate required', 'readonly':'true',
				dataInit: function(element){
					laydate.render({elem:element, type:'datetime', format:'yyyy-MM-dd HH:mm'});
				}
			}},
		{header:'${text("反馈结束日期")}', name:'feedbackEndTime', width:100,
			formatter:'date', formatoptions:{srcformat:'Y-m-d H:i',newformat:'Y-m-d H:i'},
			editable:true, edittype:'text', align:"center",editoptions:{'class':'form-control laydate required', 'readonly':'true',
				dataInit: function(element){
					laydate.render({elem:element, type:'datetime', format:'yyyy-MM-dd HH:mm'});
				}
			}},
		{header:'${text("分阶段目标任务")}', name:'feedbackRequire', editable:true},
	],

	// 编辑表格参数
	editGrid: false,				// 是否是编辑表格
	editGridInitRowNum: 0,		// 编辑表格的初始化新增行数
	emptyDataHint: false, 	// 表格内没有数据的时候是否提示 “无数据显示”  v4.1.7
	emptyDataHintContent: '<center>暂无数据</center>', // 没有数据的提示内容
	editGridAddRowBtn: $('#testDataChildDataGridAddRowBtn'),	// 子表增行按钮
	editGridAddRowBtnToHeader: false,	// 子表增行按钮是否显示到表头上
	editGridAddRowInitData: {id: '', status: Global.STATUS_NORMAL},	// 新增行的时候初始化的数据

	// 编辑表格的提交数据参数
	editGridInputFormListName: 'dcSupTaskInfoAddList', // 提交的数据列表名
	editGridInputFormListAttrs: 'id,taskId,feedbackStartTime,feedbackEndTime', // 提交数据列表的属性字段

	// 加载成功后执行事件
	ajaxSuccess: function(data){

	}
});

$('#auditResult').on('ifChecked', function(){
	if($('#auditResult input:radio:checked').val()=='2') {
		$('#auditOption').addClass("required")
	}else{
		$('#auditOption').removeClass("required")
	}
});
</script>
<style>
	.ui-jqgrid .ui-jqgrid-htable td {height:100px;}
	.ui-jqgrid .ui-jqgrid-htable td div {padding:4px 0px 3px 2px;}
	.ui-jqgrid .ui-jqgrid-frozen .ui-jqgrid-htable td div {height:100px!important;}
	.ui-jqgrid tr.jqgrow td {
		height: 60px!important;
	}
</style>